Optimal. Leaf size=90 \[ -\frac {(A-B) \sec ^3(e+f x)}{5 c^2 f \left (a^3+a^3 \sin (e+f x)\right )}+\frac {(4 A+B) \tan (e+f x)}{5 a^3 c^2 f}+\frac {(4 A+B) \tan ^3(e+f x)}{15 a^3 c^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3046, 2938,
3852} \begin {gather*} \frac {(4 A+B) \tan ^3(e+f x)}{15 a^3 c^2 f}+\frac {(4 A+B) \tan (e+f x)}{5 a^3 c^2 f}-\frac {(A-B) \sec ^3(e+f x)}{5 c^2 f \left (a^3 \sin (e+f x)+a^3\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2938
Rule 3046
Rule 3852
Rubi steps
\begin {align*} \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x))^3 (c-c \sin (e+f x))^2} \, dx &=\frac {\int \frac {\sec ^4(e+f x) (A+B \sin (e+f x))}{a+a \sin (e+f x)} \, dx}{a^2 c^2}\\ &=-\frac {(A-B) \sec ^3(e+f x)}{5 c^2 f \left (a^3+a^3 \sin (e+f x)\right )}+\frac {(4 A+B) \int \sec ^4(e+f x) \, dx}{5 a^3 c^2}\\ &=-\frac {(A-B) \sec ^3(e+f x)}{5 c^2 f \left (a^3+a^3 \sin (e+f x)\right )}-\frac {(4 A+B) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (e+f x)\right )}{5 a^3 c^2 f}\\ &=-\frac {(A-B) \sec ^3(e+f x)}{5 c^2 f \left (a^3+a^3 \sin (e+f x)\right )}+\frac {(4 A+B) \tan (e+f x)}{5 a^3 c^2 f}+\frac {(4 A+B) \tan ^3(e+f x)}{15 a^3 c^2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(237\) vs. \(2(90)=180\).
time = 0.68, size = 237, normalized size = 2.63 \begin {gather*} \frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) (240 B+54 (A-B) \cos (e+f x)-32 (4 A+B) \cos (2 (e+f x))+18 A \cos (3 (e+f x))-18 B \cos (3 (e+f x))-64 A \cos (4 (e+f x))-16 B \cos (4 (e+f x))+384 A \sin (e+f x)+96 B \sin (e+f x)+18 A \sin (2 (e+f x))-18 B \sin (2 (e+f x))+128 A \sin (3 (e+f x))+32 B \sin (3 (e+f x))+9 A \sin (4 (e+f x))-9 B \sin (4 (e+f x)))}{960 a^3 c^2 f (-1+\sin (e+f x))^2 (1+\sin (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(184\) vs.
\(2(84)=168\).
time = 0.34, size = 185, normalized size = 2.06
method | result | size |
risch | \(\frac {4 i \left (24 i A \,{\mathrm e}^{3 i \left (f x +e \right )}+6 i B \,{\mathrm e}^{3 i \left (f x +e \right )}+15 B \,{\mathrm e}^{4 i \left (f x +e \right )}+8 i A \,{\mathrm e}^{i \left (f x +e \right )}-8 A \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i B \,{\mathrm e}^{i \left (f x +e \right )}-2 B \,{\mathrm e}^{2 i \left (f x +e \right )}-4 A -B \right )}{15 \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )^{5} \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )^{3} f \,a^{3} c^{2}}\) | \(136\) |
derivativedivides | \(\frac {-\frac {-2 A +2 B}{2 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{4}}-\frac {2 \left (A -B \right )}{5 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{5}}-\frac {-\frac {3 A}{2}+B}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 \left (\frac {5 A}{2}-2 B \right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}-\frac {2 \left (\frac {11 A}{16}-\frac {3 B}{16}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\frac {2 \left (\frac {B}{4}+\frac {A}{4}\right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3}}-\frac {\frac {B}{4}+\frac {A}{4}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}-\frac {2 \left (\frac {5 A}{16}+\frac {3 B}{16}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}}{c^{2} f \,a^{3}}\) | \(185\) |
default | \(\frac {-\frac {-2 A +2 B}{2 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{4}}-\frac {2 \left (A -B \right )}{5 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{5}}-\frac {-\frac {3 A}{2}+B}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 \left (\frac {5 A}{2}-2 B \right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}-\frac {2 \left (\frac {11 A}{16}-\frac {3 B}{16}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\frac {2 \left (\frac {B}{4}+\frac {A}{4}\right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3}}-\frac {\frac {B}{4}+\frac {A}{4}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}-\frac {2 \left (\frac {5 A}{16}+\frac {3 B}{16}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}}{c^{2} f \,a^{3}}\) | \(185\) |
norman | \(\frac {-\frac {6 A +4 B}{10 c f a}-\frac {4 \left (4 A +B \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{15 c f a}+\frac {A \left (\tan ^{10}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a c f}-\frac {\left (14 A +16 B \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{10 a c f}-\frac {\left (6 A +4 B \right ) \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 c f a}-\frac {\left (2 A +8 B \right ) \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 c f a}-\frac {2 \left (8 A +2 B \right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 c f a}-\frac {\left (16 A +4 B \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{5 c f a}+\frac {2 \left (8 A +2 B \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{15 c f a}+\frac {\left (38 A -28 B \right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{15 c f a}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{5} c \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3}}\) | \(318\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 704 vs.
\(2 (88) = 176\).
time = 0.30, size = 704, normalized size = 7.82 \begin {gather*} \frac {2 \, {\left (\frac {A {\left (\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {21 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {13 \, \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {25 \, \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} - \frac {5 \, \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {15 \, \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} + \frac {15 \, \sin \left (f x + e\right )^{7}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{7}} - 3\right )}}{a^{3} c^{2} + \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {6 \, a^{3} c^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {6 \, a^{3} c^{2} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} - \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )^{7}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{7}} - \frac {a^{3} c^{2} \sin \left (f x + e\right )^{8}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{8}}} + \frac {B {\left (\frac {6 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {9 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {8 \, \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {5 \, \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {10 \, \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {15 \, \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} + 3\right )}}{a^{3} c^{2} + \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {6 \, a^{3} c^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {6 \, a^{3} c^{2} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} - \frac {2 \, a^{3} c^{2} \sin \left (f x + e\right )^{7}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{7}} - \frac {a^{3} c^{2} \sin \left (f x + e\right )^{8}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{8}}}\right )}}{15 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 115, normalized size = 1.28 \begin {gather*} -\frac {2 \, {\left (4 \, A + B\right )} \cos \left (f x + e\right )^{4} - {\left (4 \, A + B\right )} \cos \left (f x + e\right )^{2} - {\left (2 \, {\left (4 \, A + B\right )} \cos \left (f x + e\right )^{2} + 4 \, A + B\right )} \sin \left (f x + e\right ) - A - 4 \, B}{15 \, {\left (a^{3} c^{2} f \cos \left (f x + e\right )^{3} \sin \left (f x + e\right ) + a^{3} c^{2} f \cos \left (f x + e\right )^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 2674 vs.
\(2 (82) = 164\).
time = 11.27, size = 2674, normalized size = 29.71 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 235 vs.
\(2 (88) = 176\).
time = 0.49, size = 235, normalized size = 2.61 \begin {gather*} -\frac {\frac {5 \, {\left (15 \, A \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 9 \, B \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 24 \, A \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 12 \, B \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 13 \, A + 7 \, B\right )}}{a^{3} c^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}^{3}} + \frac {165 \, A \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 45 \, B \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 480 \, A \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 60 \, B \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 650 \, A \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 70 \, B \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 400 \, A \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 20 \, B \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 113 \, A - 13 \, B}{a^{3} c^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{5}}}{120 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.47, size = 183, normalized size = 2.03 \begin {gather*} \frac {\left (\frac {8\,A}{15}+\frac {2\,B}{15}+\frac {16\,A\,\sin \left (e+f\,x\right )}{15}+\frac {4\,B\,\sin \left (e+f\,x\right )}{15}\right )\,{\cos \left (e+f\,x\right )}^2+\frac {2\,A}{15}+\frac {8\,B}{15}+\frac {8\,A\,\sin \left (e+f\,x\right )}{15}+\frac {2\,B\,\sin \left (e+f\,x\right )}{15}}{a^3\,c^2\,f\,\left (2\,{\cos \left (e+f\,x\right )}^3\,\sin \left (e+f\,x\right )+2\,{\cos \left (e+f\,x\right )}^3\right )}-\frac {\frac {2\,A}{5}-\frac {2\,B}{5}+\frac {2\,A\,\sin \left (e+f\,x\right )}{5}-\frac {2\,B\,\sin \left (e+f\,x\right )}{5}}{a^3\,c^2\,f\,\left (2\,\sin \left (e+f\,x\right )+2\right )}-\frac {\cos \left (e+f\,x\right )\,\left (\frac {16\,A}{15}+\frac {4\,B}{15}\right )}{a^3\,c^2\,f\,\left (2\,\sin \left (e+f\,x\right )+2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________